package com.jd.finance.core.controller.api;


import com.jd.finance.core.service.BankCardService;
import com.jd.finance.result.BaseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 * 银行卡表 前端控制器
 * </p>
 *
 * @author LiQingBo
 * @since 2022-05-17
 */
@Api(tags = "银行卡中心")
@Slf4j
@RestController
@RequestMapping("/api/core/bankCardCenter")
public class BankCardController {

    @Resource
    private BankCardService bankCardService;

    @ApiOperation("提交银行卡信息")
    @GetMapping("/submitCardInfo")
    public BaseResult submitCardInfo(Integer uid, Integer bid, String cardNumber) {
        if (!StringUtils.isAllBlank(String.valueOf(uid), String.valueOf(bid), cardNumber)) {
            log.error("提交信息为空!");
            return BaseResult.error().message("提交信息为空!");
        }

        return bankCardService.submitCardInfo(uid, bid, cardNumber);
    }
}

